import {createRouter, createWebHistory} from 'vue-router'

const routes = [
    {
        name: '登录',
        path: '/',
        component: () => import('../views/Login.vue'),
    },
    {
        name: '用户首页',
        path: '/homePage',
        component: () => import('../views/web/homePage.vue'),
        children: [
            {
                path: "/homePage",
                name: "博客",
                component: () => import('../views/web/Index.vue')
            },
            {
                path: '/homePage/:blogId',
                name: "博客详情",
                component: () => import('../views/web/blogDetail.vue')
            },
            {
                path: "/web-category",
                name: "分类",
                component: () => import('../views/web/web-category.vue')
            },
            {
                path: '/web-category/:categoryId',
                name: "分类详情",
                component: () => import('../views/web/CategoryDetail.vue')
            },
            {
                path: "/web-special",
                name: "专题",
                component: () => import('../views/web/web-special.vue')
            },
            {
                path: "/web-user",
                name: "用户",
                component: () => import('../views/web/web-user.vue')
            },
            {
                path: "/web-message",
                name: "留言板",
                component: () => import('../views/web/web-message.vue')
            },
        ]
    },
    {
        name: '首页',
        path: '/home',
        component: () => import('../views/Framework.vue'),
        redirect: "/blog/list",
        children: [
            {
                path: "/blog/list",
                name: "博客管理",
                component: () => import('../views/blog/Blog.vue')
            },
            {
                path: "/blog/category",
                name: "分类管理",
                component: () => import('../views/blog/BlogCategory.vue')
            },
            {
                path: "/special/list",
                name: "专题管理",
                component: () => import('../views/special/SpecialList.vue')
            },
            {
                path: "/special/user",
                name: "用户管理",
                component: () => import('../views/special/user.vue')
            },
            {
                path: "/settings/my",
                name: "个人信息",
                component: () => import('../views/settings/MyInfo.vue')
            },
            {
                path: "/blog/recover",
                name: "回收站",
                component: () => import('../views/blog/list.vue')
            },
        ]
    }
];
const router = createRouter({
    routes,
    history: createWebHistory(),
})
export default router